﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using ElectronicsMarket.Service.IService;
using ElectronicsMarket.Service.Models;

namespace ElectronicsMarket.Service.ServiceImpl
{
    public class ManufactureServiceImpl : IManufactureService
    {
        private ElectronicsMarketDBClassesDataContext eMEntity;

        public ManufactureServiceImpl()
        {
            eMEntity = new ElectronicsMarketDBClassesDataContext();
        }

        public List<MANUFACTURE> getAllManufacture()
        {
            return eMEntity.MANUFACTUREs.ToList();
        }

        public MANUFACTURE getManufactureById(int manufactureId)
        {
            return eMEntity.MANUFACTUREs.Where(m => m.MANUFACTURE_ID == manufactureId).FirstOrDefault();
        }
    }
}